package com.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.pojo.User;
import com.pojo.UserAndPassengerOrder;

public interface userAndPassengerOrderDao {

	public int insertOneUserAndPassengerOrder(@Param("order")UserAndPassengerOrder userAndPassengerOrder);

	public List<UserAndPassengerOrder> getUserAndPassengerOrderingByThis_users_id(@Param("this_users_id")int this_users_id);

	public int updateStateByThisUsers_id(@Param("target_users_id")Integer target_users_id, @Param("this_users_id")Integer this_users_id);//乘客取消订单

	public Integer getPassengerOrderIdByThisUsers_id(@Param("target_users_id")Integer target_users_id, @Param("this_users_id")Integer this_users_id);//取消订单后查询PassengerOrderId
	
	public List<UserAndPassengerOrder> getUserAndPassengerOrderByPassengerOrderId(@Param("passengerorder_id")Integer passengerorder_id);//通过司机订单id得到拼车的用户

	public int getCountByPassengerOrderId(@Param("passengerorder_id")Integer passengerorder_id);

	public int editStateToing(@Param("this_user_id")Integer this_user_id, @Param("passengerorder_id")Integer passengerorder_id);//司机操作用户上车

	public int editStateToEnd(@Param("this_user_id")Integer this_user_id, @Param("passengerorder_id")Integer passengerorder_id);//到达终点

	public int getCountByPassengeringOrderId(@Param("passengerorder_id")Integer passengerorder_id);//得到正在进行中的还在车上的乘客或未上车的

	public User getTargetUserByOrderId(@Param("userAndPassengerOrder_id")Integer userAndPassengerOrder_id, @Param("user_type_id")Integer user_type_id);//得到该订单拼车对象

	public UserAndPassengerOrder getOneUserAndPassengerOrderByIdAndPrice(@Param("userAndPassengerOrder_id")Integer userAndPassengerOrder_id);//查询是否由此订单
	
	public int payMoney(@Param("userAndPassengerOrder_id")Integer userAndPassengerOrder_id,@Param("price")float price);//支付结账

	
	
}
